$(function () {
    $('#btn-drawer').click(function(){
        $('[data-drawer="box"]').show();
        $('[data-drawer="box"]').find('.drawer-mask').show().prev().animate({'width':"60%"},150);
    })

    $('[data-drawer="box"]').on("click",".drawer-mask,.btn-return",function(event){
        event.stopPropagation();
        // $(selector).animate({params},speed,callback);
        let _this = this;
        if($(this).attr('class') == "btn-return"){
            _this = $(this).parent().next();
        }
        $(_this).parent().find('.drawer-mask').hide().prev().animate({'width':"0"},150,function(){
            $(_this).parent().hide();
        });
    })
})